<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<html lang="en">
	<head>
	    <meta charset="UTF-8">
	</head>
	<body>
		<div>
		<a href="/user/input.htm">新增</a>
		<a href="/user/login_form.htm">登入</a>
		<br/>
		search <br/>
		<form action="/user/list.htm" method="post">
			username: <input type="text" name="username" value="${username}"/>
			<input type="submit" value="search"/>
		</form>
			<table border="1">
				<tr>
					<td>序号</td>
					<td>用户名</td>
					<td>密码</td>
					<td>昵称</td>
					<td>编辑</td>
				</tr>
				<c:forEach items="${users}" var="u">
				<tr>
					<td>${u.id}</td>
					<td>${u.username}</td>
					<td>${u.password}</td>
					<td>${u.nickname}</td>
					<td><a href="/user/input.htm?id=${u.id}">编辑</a> | <a href="/user/delete.htm?id=${u.id}">删除</a></td>
				</tr>
				</c:forEach>
			</table>
			<c:if test="${(pageNo-1)>=0}">
				<a href="/user/list.htm?pageNo=${pageNo-1}">上一页</a>
			</c:if>
			<c:if test="${(pageNo+1) < totalPageNo}">
				<a href="/user/list.htm?pageNo=${pageNo+1}">下一页</a>
			</c:if>
		</div>
	</body>
</html>